import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import Home from "../views/Home"

import MusicDetail from "../views/MusicDetail"
import Movie from "../views/Movie"
import MovieDetail from "../views/MovieDetail"
const routes =[
    {
        path:"/",
        element:<Home/>
    },
    {
        path:"/musicDetail",
        element:<MusicDetail/>
    },
    {
        path:"/movie",
        element:<Movie/>
    }
    ,
    {
        path:"/MovieDetail",
        element:<MovieDetail/>
    }
]
function RouterView(){
    return (
        <Router>
          <Routes>
            {routes.map(item=>{
                return (<Route key={item.path} path={item.path} element={item.element}></Route>)
            })}
          </Routes>
        </Router>
      );
}

export default RouterView;
